package com.hzx.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.hzx.dao.UserDao;
import com.hzx.entity.User;

@Repository
public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao {

	public User login(String userName, String password) {
		String hql = "from User where username = ? and password = ?";
		List users = getHibernateTemplate().find(hql, userName, password);
		if (users != null && users.size() > 0) {
			return (User) users.get(0);
		}
		return null;
	}

}
